//
// Created by Bachelor on 2021/3/20.
//

#ifndef ALGORITHMS_SORTTESTHELPER_H
#define ALGORITHMS_SORTTESTHELPER_H

#include <iostream>
#include <cassert>
#include <ctime>

using namespace std;

namespace SortTestHelper {
    int *generateRandomArray(int n, int margin_left, int margin_right) {
        assert(margin_left < margin_right);
        int *arr = new int[n];
        srand(time(NULL));
        for (int i = 0; i < n; ++i) {
            arr[i] = rand() % (margin_right - margin_left + 1) + margin_left;
        }
        return arr;
    };

    template<typename T>
    void printArray(T arr[], int n) {
        for (int i = 0; i < n; ++i) {
            cout << arr[i] << " ";
        }
        cout << endl;
    };
}
#endif //ALGORITHMS_SORTTESTHELPER_H
